package com.bw.shopping.adapter;

import android.widget.ImageView;

import com.bw.mvvm_common.network.load.LoadImage;
import com.bw.shopping.R;
import com.bw.shopping.entity.CommodityEntity;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

import org.jetbrains.annotations.NotNull;

/**
 * @author KK
 * @description:
 * @date :2021/10/14 18:25
 */
public class CommodityAdapter extends BaseQuickAdapter<CommodityEntity.DataBean, BaseViewHolder> {
    public CommodityAdapter() {
        super(R.layout.item_commodity);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder baseViewHolder, CommodityEntity.DataBean dataBean) {
        ImageView imageView = baseViewHolder.findView(R.id.mGoodsDetailItemIv);
        baseViewHolder.setText(R.id.mGoodsDetailItemPriceTv,""+dataBean.getGoods_default_price());
        baseViewHolder.setText(R.id.mGoodsDetailItemTitleTv,""+dataBean.getGoods_default_sku());
        LoadImage.loadMatchImg(dataBean.getGoods_default_icon(),imageView);

    }
}
